//
//  QBWordsContent.m
//  QiuBai
//
//  Created by yaohongchao on 5/1/16.
//  Copyright © 2016 yaohongchao. All rights reserved.
//

#import "QBWordsContent.h"
#import "YYLabel.h"
#import "YYLabel+Night.h"

@interface QBWordsContent()
@property(nonatomic,weak)YYLabel *lblContent;
@end

@implementation QBWordsContent

-(instancetype)init{
    self = [super init];
    if(self){
        [self setui];
    }
    return self;
}

-(void)setui{
    YYLabel *lblContent = [[YYLabel alloc]init];
    lblContent.font = fontContentCell;
    lblContent.displaysAsynchronously = YES;
    lblContent.dk_textColorPicker = DKColorPickerWithKey(textColorCell);
    lblContent.numberOfLines = 0;
    [self addSubview:lblContent];
    self.lblContent = lblContent;
    WS(weakSelf);
    [lblContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf).offset(kMargin);
        make.right.equalTo(weakSelf).offset(-kMargin);
        make.top.bottom.equalTo(weakSelf);
    }];

}

-(void)setItem:(Item *)item{
    _item = item;
    self.lblContent.text = item.content;
}

@end
